#! /bin/bash
# deluser
# v1.0
# wangtao 2019/01/12
read -p "请输入要删除的用户: " user

id $user &>/dev/null
if [ $? -ne 0 ];then
	echo "用户$user不存在"
	exit 1
fi 

read -p "确定吗?[y/n]:" action
case "$action" in
y|Y|yes|YES)
	userdel -r $user
	echo "$user is delete"
	;;
*)
	echo "error"
esac

#read -p "确定吗?[y/n]:" action
#if [ "$action" = "y" -o "$action" = "Y" ];then
#	userdel -r $user
#	echo "$user is delete"
#else
#	echo "good"
#fi
